package zjut.raymond.collectorplus.pojo;

import androidx.annotation.Nullable;

import java.util.Objects;

public class ReferencePoint {
    private int id;     //参考点id
    private String coord;       //参考点坐标
    private int status;

    /**
     * 无参构造函数
     */
    public ReferencePoint() {
    }

    /**
     * 构造函数
     *
     * @param id
     * @param coord
     */
    public ReferencePoint(int id, String coord, int status) {
        this.id = id;
        this.coord = coord;
        this.status = status;
    }

    @Override
    public String toString() {
        return "ReferencePoint{" +
                "id=" + id +
                ", coord='" + coord + '\'' +
                ", status=" + status +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCoord() {
        return coord;
    }

    public void setCoord(String coord) {
        this.coord = coord;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o instanceof ReferencePoint) {
            ReferencePoint rp = (ReferencePoint) o;
            return id == rp.getId() &&
                    status == rp.getStatus() &&
                    coord.equals(rp.getCoord());
        }
        return false;
    }

    @Override
    public int hashCode() {
        int result = 17;
        result = result * 31 + id;
        result = result * 31 + status;
        result = result * 31 + ((coord == null) ? 0 : coord.hashCode());
        return result;
    }
}
